import request from '@/utils/request'

// 查询订单线下支付凭证列表
export function listVoucher(query) {
  return request({
    url: '/order/voucher/list',
    method: 'get',
    params: query
  })
}

// 查询订单线下支付凭证详细
export function getVoucher(id) {
  return request({
    url: '/order/voucher/' + id,
    method: 'get'
  })
}

// 查询订单线下支付凭证详细
export function getVoucherByBiz(bizType,bizId) {
  return request({
    url: '/order/voucher/' + bizType+'/'+bizId,
    method: 'get'
  })
}
// 新增订单线下支付凭证
export function addVoucher(data) {
  return request({
    url: '/order/voucher',
    method: 'post',
    data: data
  })
}

// 修改订单线下支付凭证
export function updateVoucher(data) {
  return request({
    url: '/order/voucher',
    method: 'put',
    data: data
  })
}

// 删除订单线下支付凭证
export function delVoucher(id) {
  return request({
    url: '/order/voucher/' + id,
    method: 'delete'
  })
}

// 导出订单线下支付凭证
export function exportVoucher(query) {
  return request({
    url: '/order/voucher/export',
    method: 'get',
    params: query
  })
}